package xyz.bali16.module.netdisk.service;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.IService;
import xyz.bali16.module.netdisk.entity.FileStorageStatistics;
import xyz.bali16.module.netdisk.entity.UploadFile;
import xyz.bali16.module.netdisk.entity.UploadFile;
import xyz.bali16.module.netdisk.model.file.UploadFileAddParam;
import xyz.bali16.module.netdisk.model.file.UploadFilePageParam;
import xyz.bali16.module.netdisk.model.file.UploadFileUpdateParam;


import java.util.List;

public interface UploadFileService extends IService<UploadFile> {
    IPage<UploadFile> getPage(UploadFilePageParam param);
    /**
     * 根据父目录id删除目录
     * @param id
     * @return
     */
    Integer deleteByParentFolderId(String id);

    /**
     * 根据文件仓库获取文件
     * @param fileStorageId
     * @return
     */
    List<UploadFile> getRootFilesByFileStorageId(String fileStorageId);

    /**
     * 根据文件夹Id获取文件夹内文件
     * 该函数不可用于根目录，因为每个仓库的根目录文件夹Id都为0
     * @param parentFolderId
     * @return
     */
    List<UploadFile> getFilesByParentFolderId(String parentFolderId);

    List<UploadFile> getFilesByType(String fileStorageId, Integer type);

    FileStorageStatistics getCountStatistics(String id);

    /***
     * 根据文件仓库id来添加文件
     * @param uploadFile
     * @return
     */
//    Integer addFileByFileStorageId(UploadFile uploadFile);
    /**
     * 异步删除
     **/
    void asyncRemoveById(String fileId);

    //void add(UploadFileAddParam param) throws Exception;
    //
    //void update(UploadFileUpdateParam param) throws Exception;
    //void delete(String fileUserId) throws Exception;

}
